<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
  <style>
    h4{
      color: red;
    }
    #d1{
      width: 100px;
      height: 100px;
      background-color: cyan;
    }
    .msg{
        color:white;
    }
    .error{
        background-color: red;
    }
    .success{
        background-color: green;
    }
    #d1:hover{
        background-color: orange;
    }
    h4,#d1,.error{
        border: 2px solid black;
    }
    /*a:link{color:gray;}*/
    /*a:visited{color:green;}*/
    /*a:hover{color:orange;}*/
    /*a:active{color:red;}*/
    a{
        color: red;

    }
    input[name="uname"]{
        background-color: yellow;
    }
    select[name="uname"]{
        background-color: yellow;
    }
    *{
        font-style: italic;
    }
    #d2 span{
        background-color: pink;
    }
    #d2>div>span>span{
        color: green;
    }
  </style>

</head>
<body>

    <div id="d1">我是div</div>
    <div>我是div</div>
    <p>我是段落</p>
    <h4>我是标题</h4>
    <h4>我是标题</h4>
    <hr>
    <span class="error msg">用户名不能为空！</span>
    <span class="error msg">密码不一致！</span>
    <span class="error msg">身份验证失败！</span>
    <span class="success msg">手机号格式正确~</span>
    <span class="success msg">邮箱格式正确~</span>
    <hr>
<a href="https://www.baidu.com">超链接1</a>
    <a href="abc">超链接2</a>
    <hr>
    <input type="text" name="uname">
    <input type="text" name="nickname">
<select name="uname">
    <option value="1"></option>
    <option value="2"></option>
</select>
    <hr>
<div id="d2">
    <span>111</span>
    <div>
        <span>222</span>
        <p>测试文字</p>
        <span>我是<span>333</span>段落</span>
    </div>
    <span>444</span>
</div>


</body>
</html>